class Enemy:
    """
        敌人
    """

    def __init__(self, name="", hp=0.0, atk="", atk_speed=0.0):
        self.name = name
        self.hp = hp
        self.atk = atk
        self.atk_speed = atk_speed

    def print_self(self):
        print(self.name, self.hp, self.atk, self.atk_speed)


#
enemy01 = Enemy('亚瑟', 100, '盾击', 1000)
enemy02 = Enemy('王昭君', 100, '冰雪', 2000)
enemy03 = Enemy('曹操', 100, '刀剑', 800)
list_hero_role = [enemy01, enemy02, enemy03]

# list_enemy = []
#
# for i in range(3):
#     e = Enemy()
#     e.name = input('请输入姓名：')
#     e.hp = int(input('请输入血量：'))
#     e.atk = input('请输入攻击技能：')
#     e.atk_speed = int(input('请输入攻击速度：'))
#     list_enemy.append(e)
# for item in list_enemy:
#     item.print_self()


for item in list_hero_role:
    item.print_self()


def get_enemy_for_name(list_here_role, search_name):
    for item in list_here_role:
        if search_name == item.name:
            return item


search_name = input('请输入要查找的姓名：')
re = get_enemy_for_name(list_hero_role, search_name)
if re:
    re.print_self()
else:
    print('没有找到')
